package com.afc.struts.utils;

public class LabeledBoolean
{
  public LabeledBoolean(boolean aResult, String anInfos)
  {
    result = aResult;
    infos = anInfos;
  }

  public boolean isTrue()
  {
    return result;
  }

  public String getInfos()
  {
    return infos;
  }

  protected boolean result;
  protected String infos;

  static public LabeledBoolean check(boolean aCondition, String aMessage)
  {
    if (!aCondition)
    {
      return new LabeledBoolean(false, aMessage);
    }
    return OK;
  }

  static public final LabeledBoolean OK = new LabeledBoolean(true, null);
}
